<!--
  @author heguanghua
  @since 2020/04/23 13:44
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<style>
    .tmpPwd {
        display: none;
        width: 520px;
        height: 180px;
    }

    .quote {
        width: 100%;
        border-left: none;
        font-size: 10px;
        height: 22px;
    }

    .layui-layer-page .layui-layer-content {
        position: relative;
        overflow: visible !important;
    }
</style>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/role/detail.action')},
     hasList=${#authPermit.checkPermit('/role/list.action')},
     hasAddEdit=${#authPermit.checkPermit('/role/modify/addEdit.action') && isAssignAdmin},
     hasCopy=${#authPermit.checkPermit('/role/modify/copy.action') && isAssignAdmin},
     hasModifyStatus=${#authPermit.checkPermit('/role/modify/modifyStatus.action') && isAssignAdmin},
     hasModifySort=${#authPermit.checkPermit('/role/modify/modifySort.action')},
     hasPermitTree=${#authPermit.checkPermit('/role/permit/tree.action')}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/role/list.action|">角色管理</a>
    </blockquote>

    <div class="layui-card">
        <form method="POST" class="layui-form" action="/role/list.action">
            <div th:replace="role/_query::query"></div>
        </form>

        <div class="layui-card-body">
            <div th:replace="role/_table::table"></div>
            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group" th:if="${hasModifyStatus}">
                        <button class="layui-btn layui-btn-sm" lay-event="start">启用</button>
                        <button class="layui-btn layui-btn-sm" lay-event="stop">停用</button>
                    </div>
                    <div class="layui-btn-group">
                        <a th:lay-href="|${SYS_MCC}/role/detail.action|" class="layui-btn layui-btn-sm layui-btn-primary" lay-text="角色信息" text="新增角色"
                           th:if="${hasAddEdit}">+新增角色</a>
                    </div>
                    <div class="layui-btn-group" th:if="${hasCopy}">
                        <p onclick='roleCopy()' class="layui-btn layui-btn-sm layui-btn-primary" lay-text="角色信息" text="角色">复制角色权限</p>
                    </div>
                </div>
            </script>
        </div>
    </div>
</div>

<div class="tmpPwd" id="roleCopyTmp">
    <div class="layui-elem-quote quote">
        <p style="font-size: 14px">保存后，需复制的角色权限将会被选中角色的权限覆盖</p>
    </div>
    <form class="layui-form">
        <div class="layui-form-item" id="roleSet">
            <label class="layui-form-label" style="width: 120px">复制的角色：</label>
            <div class="layui-input-block">
                <div class="layui-input-inline" style="width: 260px">
                    <select id="roleId" name="roleId" lay-search="" lay-verify="required">
                        <option class="layui-input" value="">-选择-</option>
                        <option th:value="${role.roleId}" th:text="${role.roleName}" th:each="role:${roles}">
                        </option>
                    </select>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">
    var json = {
        status: [[${vo.status}]],
        totalCount: [[${vo.totalCount}]],
        pageSize: [[${vo.pageSize}]],
        pageIndex: [[${vo.pageIndex}]],
        vo:[[${vo}]]
    };

    layui.extend({
        role_list: "role/zmn.role.list"
    }).use(['index', 'role_list']);
</script>
